package com.openapi.config;

import org.apache.kafka.common.protocol.types.Field;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;


@ConfigurationProperties(prefix = "video")
@PropertySource(value = "classpath:dictionaries.properties")
@Component
public class VedioAdressMapConfig {

    /**
     * 视频原始地址列表
     */
    private List<String> orhttpAdress =new ArrayList<>();

    /**
     * 视频映射地址列表
     */
    private List<String> maphttpAdress =new ArrayList<>();

    /**
     *视频服务器标志名列表
     */
    private List<String> oriServerName = new ArrayList<>();

    /**
     *视频服务器标识名对应地址列表
     */
    private  List<String> mapServerNameAdress = new ArrayList<>();

    /**
     *视频服务器内网端口列表
     */
    private  List<String>  innerPort = new ArrayList<>();

    /**
     *视频服务器外网端口列表
     */
    private List<String> outPort = new ArrayList<>();

    @Bean
    public List<String> getOrhttpAdress() {
        return orhttpAdress;
    }

    public void setOrhttpAdress(List<String> orhttpAdress) {
        this.orhttpAdress = orhttpAdress;
    }


    @Bean
    public List<String> getMaphttpAdress() {
        return maphttpAdress;
    }

    public void setMaphttpAdress(List<String> maphttpAdress) {
        this.maphttpAdress = maphttpAdress;
    }

    @Bean
    public List<String> getOriServerName() {
        return oriServerName;
    }

    public void setOriServerName(List<String> oriServerName) {
        this.oriServerName = oriServerName;
    }

    @Bean
    public List<String> getMapServerNameAdress() {
        return mapServerNameAdress;
    }

    public void setMapServerNameAdress(List<String> mapServerNameAdress) {
        this.mapServerNameAdress = mapServerNameAdress;
    }




    @Bean
    public List<String> getInnerPort() {
        return innerPort;
    }

    public void setInnerPort(List<String> innerPort) {
        this.innerPort = innerPort;
    }

    @Bean
    public List<String> getOutPort() {
        return outPort;
    }

    public void setOutPort(List<String> outPort) {
        this.outPort = outPort;
    }

    public  static  List<String> getOriHttpAddressBean()
    {
       return  (List<String>) SAContextHolder.getSpringBean("getOrhttpAdress");
    }

    public  static  List<String> getMapHttpAddressBean()
    {
        return  (List<String>) SAContextHolder.getSpringBean("getMaphttpAdress");
    }


    public  static  List<String> getServerNameBean()
    {
        return (List<String>) SAContextHolder.getSpringBean("getOriServerName");
    }

    public  static  List<String> getMapServerAddressBean()
    {
        return (List<String>) SAContextHolder.getSpringBean("getMapServerNameAdress");
    }

    public  static  List<String> getInnerPortBean()
    {
        return (List<String>) SAContextHolder.getSpringBean("getInnerPort");
    }

    public  static  List<String> getOutsidePortBean()
    {
        return (List<String>) SAContextHolder.getSpringBean("getOutPort");
    }



}
